package com.zhangpingyang.jwttoken.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Zhang Pingyang
 * @Date: 2019/11/11 23:11
 */
//@Configuration
public class ElasticsearchConfiguration {
    @Bean
    public RestHighLevelClient client(){
        RestHighLevelClient client=new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("192.168.30.201",9200,"http")
//这里如果要用client去访问其他节点，就添加进去
                )
        );
        return client;
    }

}
